Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pkg/stanza] Log the entry in HandleEntryError when the transformer on_error mode is send_quiet or drop_quiet #36899

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

namco1992
Copy link
Contributor

Description

The HandleEntryError is used in many places for handling parsing errors. Sometimes the error itself is not very helpful, e.g. the syslog parser return errors like "parsing error [col 66]", which is quite hard to understand without seeing the actual entry.

This PR logs the entry when the error mode is send_quiet or drop_quiet in debug level. It shouldn't add too much noise and could be very helpful in debugging.

mode is send_quiet or drop_quiet

The `HandleEntryError` is used in many places for handling parsing
errors. Sometimes the error itself is not very helpful, e.g. the syslog
parser return errors like "parsing error [col 66]", which is quite hard
to understand without seeing the actual entry.

This PR logs the entry when the error mode is `send_quiet` or
`drop_quiet` in debug level. It shouldn't add too much noise
and could be very helpful in debugging.
@namco1992 namco1992 force-pushed the handle-error-log-entry branch from 8a264e0 to 83e2848 Compare December 19, 2024 07:59
Copy link
Member

@djaglowski djaglowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't agree that quiet mode should log the entry. This would be quite noisy wouldn't it?

@namco1992
Copy link
Contributor Author

I don't agree that quiet mode should log the entry. This would be quite noisy wouldn't it?

I've thought about it too, so I only added it to the quiet mode so it only logs on the debug level. My train of thought is:

  • The user can choose not to set log level to debug, if they want it to be "quiet", this behaviour is unchanged.
  • When a user explicitly set the log level to debug, I assume that they would expect to see more details for debugging purposes, and the entry logged there would be helpful to reveal why there is an error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants